package com.example.zyl.common.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MinioConfig {

    @Value("${minio.url}")
    public String minioUrl;

    @Value("${minio.accessKey}")
    public String accessKey;

    @Value("${minio.secretKey}")
    public String secretKey;

    @Bean
    public MinioClient minioClient() {
        try {
           return new MinioClient(minioUrl,accessKey, secretKey);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
